<?php

include 'common.php';

if (!$_SGLOBAL['supe_uid']) {
    header("Location:login.php?ac=setup");
}

$acs = array('home', 'email', 'global', 'profile', 'company', 'support');
$ac = in_array($_GET['ac'], $acs) ? $_GET['ac'] : 'home';
$op = isset($_GET['op']) ? $_GET['op'] : '';


if ($_SGLOBAL['supe_gid'] != 1) {
    Utils::showMessage('access_denied');
}

//选项卡
if (in_array($ac, array('email', 'profile', 'global'))) {
    $submenu['prefs'] = ' style="display:block;" ';
} elseif ($ac == 'company') {
    $submenu['company'] = ' style="display:block;" ';
} elseif ($ac == 'support') {
    $submenu['support'] = ' style="display:block;" ';
} else {
    $submenu['none'] = ' style="display:block;" ';
}
$_SGLOBAL['view']->assign('submenu', $submenu);
$_SGLOBAL['view']->assign('ac', $ac);
$_SGLOBAL['view']->assign('op',$op);

include S_ROOT . '/setup/' . $ac . '.php';
?>
